﻿@page
@model Shopping.Web.Pages.ProductListModel
@{
    ViewData["Title"] = "Product";
}

<div class="container">
    <div class="row">
        <div class="col">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a asp-page="Index">Home</a></li>
                    <li class="breadcrumb-item"><a asp-page="Product">Category</a></li>
                    <li class="breadcrumb-item active" aria-current="page">@Model.SelectedCategory</li>
                </ol>
            </nav>
        </div>
    </div>
</div>

<div class="container">
    <div class="row">
        <div class="col-12 col-sm-3">
            <div class="card bg-light mb-3">
                <div class="card-header bg-primary text-white text-uppercase"><i class="fa fa-list"></i> Categories</div>
                <ul class="list-group category_block">

                    @foreach (var category in Model.CategoryList)
                    {
                        <li class="list-group-item"><a asp-page="Product" asp-route-categoryId="@category">@category</a></li>
                    }

                </ul>
            </div>

            <div class="card bg-light mb-3">
                <div class="card-header bg-success text-white text-uppercase">Last product</div>
                <div class="card-body">
                    <img asp-append-version="true" class="img-fluid" src="~/images/product/@Model.ProductList.LastOrDefault().ImageFile" />
                    <h5 class="card-title">@Model.ProductList.LastOrDefault().Name</h5>
                    <p class="card-text">@Model.ProductList.LastOrDefault().Description</p>
                    <p class="bloc_left_price">@Model.ProductList.LastOrDefault().Price $</p>
                </div>
            </div>

        </div>

        <div class="col">
            <div class="row">

                @foreach (var product in Model.ProductList)
                {
                    <div class="col-12 col-md-6 col-lg-4">
                        <partial name="_ProductItemPartial" model="@product" />
                    </div>
                }

                <div class="col-12">
                    <nav aria-label="...">
                        <ul class="pagination">
                            <li class="page-item disabled">
                                <a class="page-link" href="#" tabindex="-1">Previous</a>
                            </li>
                            <li class="page-item"><a class="page-link" href="#">1</a></li>
                            <li class="page-item active">
                                <a class="page-link" href="#">2 <span class="sr-only">(current)</span></a>
                            </li>
                            <li class="page-item"><a class="page-link" href="#">3</a></li>
                            <li class="page-item">
                                <a class="page-link" href="#">Next</a>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>

    </div>
</div>



